package com.chalk.service;

import com.baomidou.mybatisplus.service.IService;
import com.chalk.model.TaskJob;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.Trigger;

/**
 * 系统定时任务表(TaskJob)表服务接口
 *
 * @author maxiaoqiang
 * @since 2019-03-28 09:54:29
 */
public interface TaskJobService extends IService<TaskJob> {

    /*自定义接口*/

    /**
     * 根据主键批量(逻辑)删除
     *
     * @param ids
     * @return
     */
    int deleteBatchByPrimaryKey(String[] ids);

    //获取JobDataMap.(Job参数对象)
    JobDataMap getJobDataMap(TaskJob job);

    //获取JobDetail,JobDetail是任务的定义,而Job是任务的执行逻辑,JobDetail里会引用一个Job Class来定义
    JobDetail geJobDetail(JobKey jobKey, String description, JobDataMap map);

    //获取Trigger (Job的触发器,执行规则)
    Trigger getTrigger(TaskJob job);

    //获取JobKey,包含Name和Group
    JobKey getJobKey(TaskJob job);
}